package com.gjy.monitor.config;

import com.gjy.monitor.yaml.PrometheusModule;
import io.prometheus.client.exporter.PushGateway;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import javax.annotation.Resource;

/**
 * @author gjy
 * @version 1.0
 * @since 2025-02-15 10:28:15
 */
@Configuration
public class PushGatewayConfig {

    @Resource
    private PrometheusModule prometheusModule;

    @Bean
    public PushGateway pushGateway() {
        return new PushGateway(prometheusModule.getPushGatewayUrl());
    }
}
